package com.frame.work.frame.deal.util;

import com.frame.work.config.SpringUtil;
import com.frame.work.entity.TblSecurityLog;
import com.frame.work.service.TblSecurityLogService;

/**
 * @author wjming
 * @ClassName: SaveLogUtil
 * @Description:保存日志信息工具类
 * @Date 2021/1/27 10:54
 */
public class SaveLogUtil {
    /**
     * @Description: 设备报警日志信息保存
     * @param: gatewayMac
     * @param: deviceMac
     * @param: content
     * @param: type
     * @param: userId
     * @return: void
     * @author:wjming
     * @Date:2021/1/27 10:57
     */
    public static void saveLog(String gatewayMac, String deviceMac, String content, String type, String userId) {
        //保存报警信息
        TblSecurityLog tblSecurityLog = new TblSecurityLog();
        tblSecurityLog.setGatewayMac(gatewayMac);
        tblSecurityLog.setDeviceMac(deviceMac);
        tblSecurityLog.setContent(content);
        tblSecurityLog.setType(type);

        tblSecurityLog.setUserId(userId);
        TblSecurityLogService tblSecurityLogService = SpringUtil.getBean(TblSecurityLogService.class);
        tblSecurityLogService.insert(tblSecurityLog);
    }
}
